<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>api_shim.core.parsetools</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;api_shim ::
        <a href="api_shim.core-module.html">Package&nbsp;core</a> ::
        Module&nbsp;parsetools
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="api_shim.core.parsetools-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="api_shim.core.parsetools-module.html">Module api_shim.core.parsetools</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright 2011 the original author or authors.</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Licensed under the Apache License, Version 2.0 (the "License");</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># you may not use this file except in compliance with the License.</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You may obtain a copy of the License at</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#      http://www.apache.org/licenses/LICENSE-2.0</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Unless required by applicable law or agreed to in writing, software</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># distributed under the License is distributed on an "AS IS" BASIS,</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># See the License for the specific language governing permissions and</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># limitations under the License.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">org</tt><tt class="py-op">.</tt><tt id="link-0" class="py-name" targets="Module api_shim.vertx=api_shim.vertx-module.html"><a title="api_shim.vertx" class="py-name" href="#" onclick="return doclink('link-0', 'vertx', 'link-0');">vertx</a></tt><tt class="py-op">.</tt><tt class="py-name">java</tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package api_shim.core=api_shim.core-module.html"><a title="api_shim.core" class="py-name" href="#" onclick="return doclink('link-1', 'core', 'link-1');">core</a></tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Module api_shim.core.parsetools=api_shim.core.parsetools-module.html"><a title="api_shim.core.parsetools" class="py-name" href="#" onclick="return doclink('link-2', 'parsetools', 'link-2');">parsetools</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Class api_shim.core.parsetools.RecordParser=api_shim.core.parsetools.RecordParser-class.html"><a title="api_shim.core.parsetools.RecordParser" class="py-name" href="#" onclick="return doclink('link-3', 'RecordParser', 'link-3');">RecordParser</a></tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name"><a title="api_shim.core" class="py-name" href="#" onclick="return doclink('link-4', 'core', 'link-1');">core</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Module api_shim.core.buffer=api_shim.core.buffer-module.html"><a title="api_shim.core.buffer" class="py-name" href="#" onclick="return doclink('link-5', 'buffer', 'link-5');">buffer</a></tt> <tt class="py-keyword">import</tt> <tt id="link-6" class="py-name" targets="Class api_shim.core.buffer.Buffer=api_shim.core.buffer.Buffer-class.html"><a title="api_shim.core.buffer.Buffer" class="py-name" href="#" onclick="return doclink('link-6', 'Buffer', 'link-6');">Buffer</a></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-name">__author__</tt> <tt class="py-op">=</tt> <tt class="py-string">"Scott Horn"</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable api_shim.core.buffer.__email__=api_shim.core.buffer-module.html#__email__,Variable api_shim.core.event_bus.__email__=api_shim.core.event_bus-module.html#__email__,Variable api_shim.core.file_system.__email__=api_shim.core.file_system-module.html#__email__,Variable api_shim.core.handlers.__email__=api_shim.core.handlers-module.html#__email__,Variable api_shim.core.http.__email__=api_shim.core.http-module.html#__email__,Variable api_shim.core.javautils.__email__=api_shim.core.javautils-module.html#__email__,Variable api_shim.core.net.__email__=api_shim.core.net-module.html#__email__,Variable api_shim.core.parsetools.__email__=api_shim.core.parsetools-module.html#__email__,Variable api_shim.core.shared_data.__email__=api_shim.core.shared_data-module.html#__email__,Variable api_shim.core.sock_js.__email__=api_shim.core.sock_js-module.html#__email__,Variable api_shim.core.ssl_support.__email__=api_shim.core.ssl_support-module.html#__email__,Variable api_shim.core.streams.__email__=api_shim.core.streams-module.html#__email__,Variable api_shim.core.tcp_support.__email__=api_shim.core.tcp_support-module.html#__email__,Variable api_shim.vertx.__email__=api_shim.vertx-module.html#__email__"><a title="api_shim.core.buffer.__email__
api_shim.core.event_bus.__email__
api_shim.core.file_system.__email__
api_shim.core.handlers.__email__
api_shim.core.http.__email__
api_shim.core.javautils.__email__
api_shim.core.net.__email__
api_shim.core.parsetools.__email__
api_shim.core.shared_data.__email__
api_shim.core.sock_js.__email__
api_shim.core.ssl_support.__email__
api_shim.core.streams.__email__
api_shim.core.tcp_support.__email__
api_shim.vertx.__email__" class="py-name" href="#" onclick="return doclink('link-7', '__email__', 'link-7');">__email__</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"scott@hornmicro.com"</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt id="link-8" class="py-name" targets="Variable api_shim.core.buffer.__credits__=api_shim.core.buffer-module.html#__credits__,Variable api_shim.core.event_bus.__credits__=api_shim.core.event_bus-module.html#__credits__,Variable api_shim.core.file_system.__credits__=api_shim.core.file_system-module.html#__credits__,Variable api_shim.core.handlers.__credits__=api_shim.core.handlers-module.html#__credits__,Variable api_shim.core.http.__credits__=api_shim.core.http-module.html#__credits__,Variable api_shim.core.javautils.__credits__=api_shim.core.javautils-module.html#__credits__,Variable api_shim.core.net.__credits__=api_shim.core.net-module.html#__credits__,Variable api_shim.core.parsetools.__credits__=api_shim.core.parsetools-module.html#__credits__,Variable api_shim.core.shared_data.__credits__=api_shim.core.shared_data-module.html#__credits__,Variable api_shim.core.sock_js.__credits__=api_shim.core.sock_js-module.html#__credits__,Variable api_shim.core.ssl_support.__credits__=api_shim.core.ssl_support-module.html#__credits__,Variable api_shim.core.streams.__credits__=api_shim.core.streams-module.html#__credits__,Variable api_shim.core.tcp_support.__credits__=api_shim.core.tcp_support-module.html#__credits__,Variable api_shim.vertx.__credits__=api_shim.vertx-module.html#__credits__"><a title="api_shim.core.buffer.__credits__
api_shim.core.event_bus.__credits__
api_shim.core.file_system.__credits__
api_shim.core.handlers.__credits__
api_shim.core.http.__credits__
api_shim.core.javautils.__credits__
api_shim.core.net.__credits__
api_shim.core.parsetools.__credits__
api_shim.core.shared_data.__credits__
api_shim.core.sock_js.__credits__
api_shim.core.ssl_support.__credits__
api_shim.core.streams.__credits__
api_shim.core.tcp_support.__credits__
api_shim.vertx.__credits__" class="py-name" href="#" onclick="return doclink('link-8', '__credits__', 'link-8');">__credits__</a></tt> <tt class="py-op">=</tt> <tt class="py-string">"Based entirely on work by Tim Fox http://tfox.org"</tt> </tt>
<a name="RecordParser"></a><div id="RecordParser-def"><a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt> <a class="py-toggle" href="#" id="RecordParser-toggle" onclick="return toggle('RecordParser');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html">RecordParser</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RecordParser-expanded"><a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line">    <tt class="py-docstring">"""A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-docstring">    size records.</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-docstring">    Instances of this class take as input Buffer instances containing raw bytes, and output records.</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-docstring">    For example, if I had a simple ASCII text protocol delimited by '\\n' and the input was the following:</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">    buffer1:HELLO\\nHOW ARE Y</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">    buffer2:OU?\\nI AM</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">    buffer3: DOING OK</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">    buffer4:\\n</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-docstring">    Then the output would be:</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-docstring">    buffer1:HELLO</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt class="py-docstring">    buffer2:HOW ARE YOU?</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-docstring">    buffer3:I AM DOING OK</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"><tt class="py-docstring">    Instances of this class can be changed between delimited mode and fixed size record mode on the fly as</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt class="py-docstring">    individual records are read, this allows you to parse protocols where, for example, the first 5 records might</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"><tt class="py-docstring">    all be fixed size (of potentially different sizes), followed by some delimited records, followed by more fixed</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"><tt class="py-docstring">    size records.</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"><tt class="py-docstring">    Instances of this class can't currently be used for protocols where the text is encoded with something other than</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-docstring">    a 1-1 byte-char mapping. TODO extend this class to cope with arbitrary character encodings.</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"> </tt>
<a name="RecordParser.__init__"></a><div id="RecordParser.__init__-def"><a name="L49"></a><tt class="py-lineno"> 49</tt> <a class="py-toggle" href="#" id="RecordParser.__init__-toggle" onclick="return toggle('RecordParser.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">java_parser</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.__init__-expanded"><a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">java_parser</tt> <tt class="py-op">=</tt> <tt class="py-name">java_parser</tt> </tt>
</div><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">  </tt>
<a name="RecordParser.__call__"></a><div id="RecordParser.__call__-def"><a name="L52"></a><tt class="py-lineno"> 52</tt> <a class="py-toggle" href="#" id="RecordParser.__call__-toggle" onclick="return toggle('RecordParser.__call__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#__call__">__call__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.__call__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.__call__-expanded"><a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method api_shim.core.http.RouteMatcher.input()=api_shim.core.http.RouteMatcher-class.html#input,Method api_shim.core.parsetools.RecordParser.input()=api_shim.core.parsetools.RecordParser-class.html#input"><a title="api_shim.core.http.RouteMatcher.input
api_shim.core.parsetools.RecordParser.input" class="py-name" href="#" onclick="return doclink('link-9', 'input', 'link-9');">input</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
</div><a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">   </tt>
<a name="RecordParser.input"></a><div id="RecordParser.input-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="RecordParser.input-toggle" onclick="return toggle('RecordParser.input');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#input">input</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.input-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.input-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">        <tt class="py-docstring">"""This method is called to provide the parser with data.</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line"><tt class="py-docstring">        @param data: Input buffer  to the parser.</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">java_parser</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method api_shim.core.event_bus.InternalHandler.handle()=api_shim.core.event_bus.InternalHandler-class.html#handle,Method api_shim.core.handlers.AsyncHandler.handle()=api_shim.core.handlers.AsyncHandler-class.html#handle,Method api_shim.core.handlers.BufferHandler.handle()=api_shim.core.handlers.BufferHandler-class.html#handle,Method api_shim.core.handlers.CloseHandler.handle()=api_shim.core.handlers.CloseHandler-class.html#handle,Method api_shim.core.handlers.ContinueHandler.handle()=api_shim.core.handlers.ContinueHandler-class.html#handle,Method api_shim.core.handlers.DoneHandler.handle()=api_shim.core.handlers.DoneHandler-class.html#handle,Method api_shim.core.handlers.DrainHandler.handle()=api_shim.core.handlers.DrainHandler-class.html#handle,Method api_shim.core.handlers.ExceptionHandler.handle()=api_shim.core.handlers.ExceptionHandler-class.html#handle,Method api_shim.core.handlers.NullAsyncHandler.handle()=api_shim.core.handlers.NullAsyncHandler-class.html#handle,Method api_shim.core.handlers.NullDoneHandler.handle()=api_shim.core.handlers.NullDoneHandler-class.html#handle,Method api_shim.core.handlers.StreamEndHandler.handle()=api_shim.core.handlers.StreamEndHandler-class.html#handle,Method api_shim.core.handlers.TimerHandler.handle()=api_shim.core.handlers.TimerHandler-class.html#handle,Method api_shim.core.http.HttpClientResponseHandler.handle()=api_shim.core.http.HttpClientResponseHandler-class.html#handle,Method api_shim.core.http.HttpServerFileUploadHandler.handle()=api_shim.core.http.HttpServerFileUploadHandler-class.html#handle,Method api_shim.core.http.HttpServerRequestHandler.handle()=api_shim.core.http.HttpServerRequestHandler-class.html#handle,Method api_shim.core.http.ServerWebSocketHandler.handle()=api_shim.core.http.ServerWebSocketHandler-class.html#handle,Method api_shim.core.http.WebSocketHandler.handle()=api_shim.core.http.WebSocketHandler-class.html#handle,Method api_shim.core.net.ConnectHandler.handle()=api_shim.core.net.ConnectHandler-class.html#handle,Method api_shim.core.parsetools.RecordParserHandler.handle()=api_shim.core.parsetools.RecordParserHandler-class.html#handle,Method api_shim.core.sock_js.SockJSSocketHandler.handle()=api_shim.core.sock_js.SockJSSocketHandler-class.html#handle"><a title="api_shim.core.event_bus.InternalHandler.handle
api_shim.core.handlers.AsyncHandler.handle
api_shim.core.handlers.BufferHandler.handle
api_shim.core.handlers.CloseHandler.handle
api_shim.core.handlers.ContinueHandler.handle
api_shim.core.handlers.DoneHandler.handle
api_shim.core.handlers.DrainHandler.handle
api_shim.core.handlers.ExceptionHandler.handle
api_shim.core.handlers.NullAsyncHandler.handle
api_shim.core.handlers.NullDoneHandler.handle
api_shim.core.handlers.StreamEndHandler.handle
api_shim.core.handlers.TimerHandler.handle
api_shim.core.http.HttpClientResponseHandler.handle
api_shim.core.http.HttpServerFileUploadHandler.handle
api_shim.core.http.HttpServerRequestHandler.handle
api_shim.core.http.ServerWebSocketHandler.handle
api_shim.core.http.WebSocketHandler.handle
api_shim.core.net.ConnectHandler.handle
api_shim.core.parsetools.RecordParserHandler.handle
api_shim.core.sock_js.SockJSSocketHandler.handle" class="py-name" href="#" onclick="return doclink('link-10', 'handle', 'link-10');">handle</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method api_shim.core.buffer.Buffer._to_java_buffer()=api_shim.core.buffer.Buffer-class.html#_to_java_buffer"><a title="api_shim.core.buffer.Buffer._to_java_buffer" class="py-name" href="#" onclick="return doclink('link-11', '_to_java_buffer', 'link-11');">_to_java_buffer</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="RecordParser.new_delimited"></a><div id="RecordParser.new_delimited-def"><a name="L62"></a><tt class="py-lineno"> 62</tt> <a class="py-toggle" href="#" id="RecordParser.new_delimited-toggle" onclick="return toggle('RecordParser.new_delimited');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#new_delimited">new_delimited</a><tt class="py-op">(</tt><tt class="py-param">delim</tt><tt class="py-op">,</tt> <tt class="py-param">handler</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.new_delimited-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.new_delimited-expanded"><a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">        <tt class="py-docstring">"""Create a new RecordParser instance, initially in delimited mode, and where the delimiter can be represented</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">        by a delimiter string endcoded in latin-1 . Don't use this if your String contains other than latin-1 characters.</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">        Keyword arguments:</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">        @param delim: The delimiter string.</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">        @param handler: the output handler</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">        @return: a new RecordParser</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-12" class="py-name"><a title="api_shim.core.parsetools.RecordParser" class="py-name" href="#" onclick="return doclink('link-12', 'RecordParser', 'link-3');">RecordParser</a></tt><tt class="py-op">(</tt><tt class="py-name">org</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="api_shim.vertx" class="py-name" href="#" onclick="return doclink('link-13', 'vertx', 'link-0');">vertx</a></tt><tt class="py-op">.</tt><tt class="py-name">java</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="api_shim.core" class="py-name" href="#" onclick="return doclink('link-14', 'core', 'link-1');">core</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="api_shim.core.parsetools" class="py-name" href="#" onclick="return doclink('link-15', 'parsetools', 'link-2');">parsetools</a></tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="api_shim.core.parsetools.RecordParser" class="py-name" href="#" onclick="return doclink('link-16', 'RecordParser', 'link-3');">RecordParser</a></tt><tt class="py-op">.</tt><tt class="py-name">newDelimited</tt><tt class="py-op">(</tt><tt class="py-name">delim</tt><tt class="py-op">,</tt> <tt id="link-17" class="py-name" targets="Class api_shim.core.parsetools.RecordParserHandler=api_shim.core.parsetools.RecordParserHandler-class.html"><a title="api_shim.core.parsetools.RecordParserHandler" class="py-name" href="#" onclick="return doclink('link-17', 'RecordParserHandler', 'link-17');">RecordParserHandler</a></tt><tt class="py-op">(</tt><tt class="py-name">handler</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line"> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="RecordParser.new_fixed"></a><div id="RecordParser.new_fixed-def"><a name="L75"></a><tt class="py-lineno"> 75</tt> <a class="py-toggle" href="#" id="RecordParser.new_fixed-toggle" onclick="return toggle('RecordParser.new_fixed');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#new_fixed">new_fixed</a><tt class="py-op">(</tt><tt class="py-param">size</tt><tt class="py-op">,</tt> <tt class="py-param">handler</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.new_fixed-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.new_fixed-expanded"><a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt class="py-docstring">"""Create a new RecordParser instance, initially in fixed size mode.</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">        Keyword arguments:</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: the initial record size.</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">        @param handler: the output handler</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">        @return: a new RecordParser</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-18" class="py-name"><a title="api_shim.core.parsetools.RecordParser" class="py-name" href="#" onclick="return doclink('link-18', 'RecordParser', 'link-3');">RecordParser</a></tt><tt class="py-op">(</tt><tt class="py-name">org</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="api_shim.vertx" class="py-name" href="#" onclick="return doclink('link-19', 'vertx', 'link-0');">vertx</a></tt><tt class="py-op">.</tt><tt class="py-name">java</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="api_shim.core" class="py-name" href="#" onclick="return doclink('link-20', 'core', 'link-1');">core</a></tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="api_shim.core.parsetools" class="py-name" href="#" onclick="return doclink('link-21', 'parsetools', 'link-2');">parsetools</a></tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="api_shim.core.parsetools.RecordParser" class="py-name" href="#" onclick="return doclink('link-22', 'RecordParser', 'link-3');">RecordParser</a></tt><tt class="py-op">.</tt><tt class="py-name">newFixed</tt><tt class="py-op">(</tt><tt id="link-23" class="py-name" targets="Method api_shim.core.file_system.FileProps.size()=api_shim.core.file_system.FileProps-class.html#size,Method api_shim.core.http.HttpServerFileUpload.size()=api_shim.core.http.HttpServerFileUpload-class.html#size,Method api_shim.core.http.MultiMap.size()=api_shim.core.http.MultiMap-class.html#size,Method api_shim.core.shared_data.SharedSet.size()=api_shim.core.shared_data.SharedSet-class.html#size"><a title="api_shim.core.file_system.FileProps.size
api_shim.core.http.HttpServerFileUpload.size
api_shim.core.http.MultiMap.size
api_shim.core.shared_data.SharedSet.size" class="py-name" href="#" onclick="return doclink('link-23', 'size', 'link-23');">size</a></tt><tt class="py-op">,</tt> <tt id="link-24" class="py-name"><a title="api_shim.core.parsetools.RecordParserHandler" class="py-name" href="#" onclick="return doclink('link-24', 'RecordParserHandler', 'link-17');">RecordParserHandler</a></tt><tt class="py-op">(</tt><tt class="py-name">handler</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"> </tt>
<a name="RecordParser.delimited_mode"></a><div id="RecordParser.delimited_mode-def"><a name="L86"></a><tt class="py-lineno"> 86</tt> <a class="py-toggle" href="#" id="RecordParser.delimited_mode-toggle" onclick="return toggle('RecordParser.delimited_mode');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#delimited_mode">delimited_mode</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">delim</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.delimited_mode-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.delimited_mode-expanded"><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-docstring">"""Flip the parser into delimited mode. This method can be called multiple times with different values</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-docstring">        of delim while data is being parsed.</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"><tt class="py-docstring">        Keyword arguments:</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line"><tt class="py-docstring">        @param delim: the delimiter string.</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">java_parser</tt><tt class="py-op">.</tt><tt class="py-name">delimitedMode</tt><tt class="py-op">(</tt><tt class="py-name">delim</tt><tt class="py-op">)</tt> </tt>
</div><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"> </tt>
<a name="RecordParser.fixed_size_mode"></a><div id="RecordParser.fixed_size_mode-def"><a name="L95"></a><tt class="py-lineno"> 95</tt> <a class="py-toggle" href="#" id="RecordParser.fixed_size_mode-toggle" onclick="return toggle('RecordParser.fixed_size_mode');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParser-class.html#fixed_size_mode">fixed_size_mode</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParser.fixed_size_mode-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParser.fixed_size_mode-expanded"><a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt class="py-docstring">"""Flip the parser into fixed size mode. This method can be called multiple times with different values</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">        of size while data is being parsed.</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-docstring">        Keyword arguments:</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: the record size.</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">java_parser</tt><tt class="py-op">.</tt><tt class="py-name">fixedSizeMode</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name"><a title="api_shim.core.file_system.FileProps.size
api_shim.core.http.HttpServerFileUpload.size
api_shim.core.http.MultiMap.size
api_shim.core.shared_data.SharedSet.size" class="py-name" href="#" onclick="return doclink('link-25', 'size', 'link-23');">size</a></tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"> </tt>
<a name="RecordParserHandler"></a><div id="RecordParserHandler-def"><a name="L104"></a><tt class="py-lineno">104</tt> <a class="py-toggle" href="#" id="RecordParserHandler-toggle" onclick="return toggle('RecordParserHandler');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParserHandler-class.html">RecordParserHandler</a><tt class="py-op">(</tt><tt class="py-base-class">org</tt><tt class="py-op">.</tt><tt class="py-base-class">vertx</tt><tt class="py-op">.</tt><tt class="py-base-class">java</tt><tt class="py-op">.</tt><tt class="py-base-class">core</tt><tt class="py-op">.</tt><tt class="py-base-class">Handler</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParserHandler-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="RecordParserHandler-expanded"><a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">    <tt class="py-docstring">""" Record Parser handler """</tt> </tt>
<a name="RecordParserHandler.__init__"></a><div id="RecordParserHandler.__init__-def"><a name="L106"></a><tt class="py-lineno">106</tt> <a class="py-toggle" href="#" id="RecordParserHandler.__init__-toggle" onclick="return toggle('RecordParserHandler.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParserHandler-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">handler</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParserHandler.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParserHandler.__init__-expanded"><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">handler</tt> <tt class="py-op">=</tt> <tt class="py-name">handler</tt> </tt>
</div><a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
<a name="RecordParserHandler.handle"></a><div id="RecordParserHandler.handle-def"><a name="L109"></a><tt class="py-lineno">109</tt> <a class="py-toggle" href="#" id="RecordParserHandler.handle-toggle" onclick="return toggle('RecordParserHandler.handle');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="api_shim.core.parsetools.RecordParserHandler-class.html#handle">handle</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">buffer</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="RecordParserHandler.handle-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="RecordParserHandler.handle-expanded"><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-docstring">""" Call the handler after buffer parsed"""</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">handler</tt><tt class="py-op">(</tt><tt id="link-26" class="py-name"><a title="api_shim.core.buffer.Buffer" class="py-name" href="#" onclick="return doclink('link-26', 'Buffer', 'link-6');">Buffer</a></tt><tt class="py-op">(</tt><tt id="link-27" class="py-name"><a title="api_shim.core.buffer" class="py-name" href="#" onclick="return doclink('link-27', 'buffer', 'link-5');">buffer</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Wed Jul 17 20:25:01 2013
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>